import Vue from 'vue';
import App from './App.vue';
import router from './router';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css'
import axios from 'axios';       
import { handleTree } from "./utils/ruoyi";
import * as echarts from 'echarts';
import './assets/icon/iconfont.css'

import 'echarts-gl';

Vue.prototype.$echarts = echarts


Vue.prototype.handleTree = handleTree


axios.defaults.baseURL="http://localhost:8088/"
axios.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8'

axios.interceptors.request.use(function (config){
    let token =localStorage.getItem("token")
    if(token){
      config.headers['Authorization'] = "Bearer"+token
      return config;
    }
   return config;
}, function (error){
  return Promise.reject(error)
})

Vue.use(ElementUI)
new Vue({
  router,
  render: h => h(App),
}).$mount('#app')

